<?php
namespace App;

use Illuminate\Support\Facades\DB;
use Illuminate\Database\Eloquent\Model;
class Qd extends Model
{
    public static function adds($open_id)
    {
        $data['open_id']=$open_id;
        $data['status']="1";//1代表QQ状态正常
        return Db::table("user")->insertGetId($data);
    }
    
    
    
    public static function F( $request )
    {
        $tel = $request['tel'];
        $rand = rand(1000,9999);
        $statusStr = array(
            "0" => "短信发送成功",
            "-1" => "参数不全",
            "-2" => "服务器空间不支持,请确认支持curl或者fsocket，联系您的空间商解决或者更换空间！",
            "30" => "密码错误",
            "40" => "账号不存在",
            "41" => "余额不足",
            "42" => "帐户已过期",
            "43" => "IP地址限制",
            "50" => "内容含有敏感词"
            );
            $smsapi = "http://api.smsbao.com/";
            $user = "wyx1185271120"; //短信平台帐号
            $pass = md5("wen123456"); //短信平台密码
            $content="温馨提示：
            由于技能时间过长，录屏中时刻检查好自己的录屏信息，避免出现摄像头卡顿、电脑黑屏等现象！考试是为了检测当周所学程度，找到自己的问题，切勿作弊！作弊可耻！本次测试验证码为:$rand";//要发送的短信内容
            $phone = $tel;//要发送短信的手机号码
            $sendurl = $smsapi."sms?u=".$user."&p=".$pass."&m=".$phone."&c=".urlencode($content);
            $result =file_get_contents($sendurl) ;
            echo $statusStr[$result];
    }
}

?>